package com.accesshollywood.SQL;

import com.accesshollywood.indexables.Indexable;

public class IndexedSQL<T>{// implements Indexable{
	/*
	public int		id;
	public T		element;
	public String	tableName;
	public String	idColumnName;
	public String	elementColumnName;

	public IndexedSQL() {
		id = -1;
		element = null;
	}

	public IndexedSQL(int id, T element) {
		setID(id);
		setElement(element, false);
	}

	public void setSQL(String tableName, String idColumnName, String elementColumnName) {
		this.tableName = tableName;
		this.idColumnName = idColumnName;
		this.elementColumnName = elementColumnName;
	}

	public int getID() {
		return id;
	}

	public void setID(int id) {
		this.id = id;
	}

	public T getElement() {
		return element;
	}

	public void setElement(T newElement, boolean toSQL) {
		if (toSQL) {
			if (newElement instanceof Indexable) {
				((Indexable) this.element).setValue(newElement, toSQL);
			} else {
				this.element = newElement;
				GFXSQL.alterObject(tableName, elementColumnName, this.element, idColumnName + "=" + id);
			}
		} else {
			this.element = newElement;
		}
	}

	public void setElement(T newElement) {
		setElement(newElement, false);
	}

	public String toString() {
		if (element != null) {
			return element.toString();
		} else {
			return "";
		}
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((element == null) ? 0 : element.hashCode());
		result = prime * result + id;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		IndexedSQL other = (IndexedSQL) obj;
		if (element == null) {
			if (other.element != null)
				return false;
		} else if (!element.equals(other.element))
			return false;
		if (id != other.id)
			return false;
		return true;
	}

	public boolean isEmpty() {
		if (element instanceof Indexable) {
			return ((Indexable) element).isEmpty();
		} else {
			return element != null;
		}
	}

	@Override
	public void initSQL() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setElement(Object newValue, boolean toSQL) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public Object getElement(boolean fromSQL) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void toSQL() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void fromSQL() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void fromSQL(int id) {
		// TODO Auto-generated method stub
		
	}
*/
}
